package com.demo.controller;

import com.demo.entity.User;
import com.honvay.hdms.framework.core.protocol.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequestMapping("/user")
public class HelloController {

    @Autowired
    private UserServiceImpl userService;

    /**
     * @return
     */
    @PostMapping("login")
    public Object login(@RequestBody User user) {
        System.out.println(user);
        user.setToken("abc");
        return Result.success(user);
    }
    /**
     * @return
     */
    @GetMapping("info")
    public Object info(String token) {
        User user = new User();
        user.setUsername("admin");
        return Result.success(user);
    }

}